<template>
  <div class="app">
    <!-- PC端 -->
    <!-- <div class="wrapper">
      <Drawer />
      <div>
        <div>  <WalletTitle title="矿池" /></div> 
        <router-view></router-view>
      </div>
    </div> -->
    <!-- 移动端 -->
    <div>
      <div class="wrapper">
        <div v-if="isPC">
          <Drawer />
        </div>
        <div class="wrapper-inner">
          <div v-if="isPC">
            <WalletTitle title="矿池" />
          </div>
          <div v-else>
            <ZilHeader @showDialog="showDialog" />
          </div>
          <div v-if="!isPC">
            <div class="dialog" v-if="dialogType" @click="closeDialog">
              <Drawer />
            </div>
          </div>
          <router-view></router-view>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import Drawer from "@/components/drawer";
import WalletTitle from "@/components/walletTitle";
import ZilHeader from "@/components/header";
export default {
  name: "zil",
  components: {
    Drawer,
    ZilHeader,
    WalletTitle,
  },

  data: () => ({
    dialogType: false,
  }),
  computed: {
    isPC() {
      return this.$store.state.clientWidth > 960 ? true : false;
    },
  },
  mounted() {},
  methods: {
    showDialog() {
      this.dialogType = true;
    },
    closeDialog() {
      this.dialogType = false;
    },
  },
};
</script>
<style scoped lang="scss">
.app {
  min-height: 100vh;
  background: #f7f7f7;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  .wrapper {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    padding-left: 288px;
    @media screen and (min-width: 300px) and (max-width: 980px) {
      padding-left: 0;
    }
  }
  .wrapper-inner {
    -webkit-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
    overflow: hidden;
  }
  .dialog {
    // display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: transparent;
    z-index: 3;
    pointer-events: none;
    -webkit-transition: background-color 0.3s ease;
    transition: background-color 0.3s ease;
    background-color: rgba(0, 0, 0, 0.68);
    pointer-events: unset;
  }
}
</style>